<?php namespace Home\Controller; 
use Hdphp\Controller\Controller;

class RegController extends Controller{
	private $userModel;
	//实例化用户表
	public function __init(){
		$this->userModel = new \Common\Model\User;
	}
	public function index(){
		//如果验证不通过提示错误，如果验证通过了提示成功让用户去登陆
		if(IS_POST){
			if(!$this->userModel->store()){
				View::error($this->userModel->getError());
			}else{
				View::success('注册成功',U('Login/index'));
			}
			
		}
	  
	    View::make();
	}

	//显示验证码
	public function code(){
		Code::make();
	}
}






















?>